
from flask import Flask, request,json,make_response
app = Flask(__name__)

@app.route('/index',methods=['GET','POST'])
def index():

    if request.method == 'POST':
        data = request.get_data()
        data = data.decode(encoding='utf-8')
        # content = {"name":"2333"};
        text = json.loads(data)
        response = make_response(json.dumps(data, ensure_ascii=False))
        return text['name']


        # name = request.form.get('name')
        # passwd = request.form.get('password')
        # print(name,passwd)

        # #发送post请求 json参数直接为一个字典数据
        # a = {"mobilephone": "18611000001", "pwd": "xxxxxxxxxxxx"}
        # url = "http://XXXXXXXX"
        # headers = {'Content-Type': 'application/json;charset=UTF-8'}
        # res = request.request("post", url, json=a, headers=headers)

        # return 'post'
        # #return render_template('index.html')

if __name__ == '__main__':
    app.run()
